// ImageProcOpenCVLib.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"
#include "ImageProcOpenCVAppLib.h"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv/cv.h"

//// This is an example of an exported variable
//IMAGEPROCOPENCVLIB_API int nImageProcOpenCVLib=0;
//
//// This is an example of an exported function.
//IMAGEPROCOPENCVLIB_API int fnImageProcOpenCVLib(void)
//{
//	return 42;
//}
//
//// This is the constructor of a class that has been exported.
//// see ImageProcOpenCVLib.h for the class definition
//CImageProcOpenCVLib::CImageProcOpenCVLib()
//{
//	return;
//}


IMAGEPROCOPENCVLIB_API void IResize(double factor, const char *pathfilenameImage)
{
	using namespace cv;

	Mat outp;
	Mat inp = imread(pathfilenameImage);

	if (factor >= 0 )
		resize(inp, outp, Size(), factor, factor);
	else
		resize(inp, outp, Size(), 1/factor, 1/factor);

	namedWindow("Resized Image", CV_WINDOW_AUTOSIZE);
	imshow("Resized Image", outp);
	imwrite("output.png", outp);
	
	waitKey(0);
	destroyWindow("Resized Image");
	inp.release();
}



//IMAGEPROCOPENCVLIB_API Mat edgeDetect()
//{
//	Mat rtn;
//
//	return rtn;
//}